import request from '@/utils/request'
import {
  transformQueryCondition
} from '@/utils'
// 报纸列表查询
export function newspaperList(searchCon) {
  return request({
    url: '/zcmtask/zcm/zmzd/select',
    method: 'POST',
    data: searchCon
  })
}
// 报纸-> 模块复制
export function copyModuleRequest(searchCon) {
  return request({
    url: '/zcmtask/zcm/appNavigation/copyNavigation',
    method: 'POST',
    data: searchCon
  })
}
// 报纸列表详情
export function detailNewspaper(searchCon) {
  return request({
    url: '/zcmtask/zcm/zmzd/select',
    method: 'POST',
    data: searchCon
  })
}
// 报纸列表新建
export function newspaperNew(searchCon) {
  return request({
    url: '/zcmtask/zcm/zmzd/insert',
    method: 'POST',
    data: searchCon
  })
}
// 报纸列表删除
export function deleteNewspaper(searchCon) {
  return request({
    url: '/zcmtask/zcm/zmzd/delete/',
    method: 'POST',
    data: searchCon
  })
}
// 报纸列表修改
export function updateNewspaper(searchCon) {
  return request({
    url: '/zcmtask/zcm/zmzd/update/' + searchCon.id,
    method: 'POST',
    data: searchCon
  })
}

// 网站列表查询
export function webSiteList(searchCon) {
  return request({
    url: '/zcmtask/zcm/website/select',
    method: 'POST',
    data: searchCon
  })
}
// 网站详情
export function detailWebSite(searchCon) {
  return request({
    url: '/zcmtask/zcm/website/select',
    method: 'POST',
    data: searchCon
  })
}
// 网站新建
export function webSiteNew(searchCon) {
  return request({
    url: '/zcmtask/zcm/website/insert',
    method: 'POST',
    data: searchCon
  })
}
// 网站删除
export function deleteWebSite(searchCon) {
  return request({
    url: '/zcmtask/zcm/website/delete/',
    method: 'POST',
    data: searchCon
  })
}
// 网站修改
export function updateWebSite(searchCon) {
  return request({
    url: '/zcmtask/zcm/website/update/' + searchCon.id,
    method: 'POST',
    data: searchCon
  })
}

// app列表查询
export function appList(searchCon) {
  return request({
    url: '/zcmtask/zcm/appSite/select',
    method: 'POST',
    data: searchCon
  })
}
// app详情
export function detailApp(searchCon) {
  return request({
    url: '/zcmtask/zcm/appSite/select',
    method: 'POST',
    data: searchCon
  })
}
// app新建
export function appNew(searchCon) {
  return request({
    url: '/zcmtask/zcm/appSite/insert',
    method: 'POST',
    data: searchCon
  })
}
// app删除
export function deleteApp(searchCon) {
  return request({
    url: '/zcmtask/zcm/appSite/delete/' + searchCon.id,
    method: 'POST',
    data: searchCon
  })
}
// app修改
export function updateApp(searchCon) {
  return request({
    url: '/zcmtask/zcm/appSite/update/' + searchCon.id,
    method: 'POST',
    data: searchCon
  })
}

// weChat列表查询
export function weChatList(query) {
  const searchCon = transformQueryCondition(query)
  return request({
    url: '/zcmtask/zcm/weChat/list',
    method: 'POST',
    data: searchCon
  })
}
// weChat详情
export function detailWeChat(searchCon) {
  return request({
    url: '/zcmtask/zcm/weChat/list',
    method: 'POST',
    data: searchCon
  })
}
// weChat新建
export function weChatNew(searchCon) {
  return request({
    url: '/zcmtask/zcm/weChat/insert',
    method: 'POST',
    data: searchCon
  })
}
// weChat删除
export function deleteWeChat(searchCon) {
  return request({
    url: '/zcmtask/zcm/weChat/delete/' + searchCon.id,
    method: 'POST',
    data: searchCon
  })
}
// weChat修改
export function updateWeChat(searchCon) {
  return request({
    url: '/zcmtask/zcm/weChat/update',
    method: 'POST',
    data: searchCon
  })
}

// microBlog列表查询
export function microBlogList(query) {
  const searchCon = transformQueryCondition(query)
  return request({
    url: '/zcmtask/zcm/webo/selectList',
    method: 'POST',
    data: searchCon
  })
}
// microBlog详情
export function detailMicroBlog(searchCon) {
  return request({
    url: '/zcmtask/zcm/webo/selectList',
    method: 'POST',
    data: searchCon
  })
}
// microBlog新建
export function microBlogNew(searchCon) {
  return request({
    url: '/zcmtask/zcm/webo/save',
    method: 'POST',
    data: searchCon
  })
}
// microBlog删除
export function deleteMicroBlog(searchCon) {
  return request({
    url: '/zcmtask/zcm/webo/delete',
    method: 'POST',
    data: searchCon
  })
}
// microBlog修改
export function updateMicroBlog(searchCon) {
  return request({
    url: '/zcmtask/zcm/webo/update',
    method: 'POST',
    data: searchCon
  })
}

// modules列表查询
export function modulesList(searchCon) {
  return request({
    url: '/zcm/zcm/appSite/list',
    method: 'POST',
    data: searchCon
  })
}

// 根据站点查询模块列表
export function getModulesBySite(searchCon) {
  return request({
    url: '/zcmtask/zcm/appNavigation/select',
    method: 'POST',
    data: searchCon
  })
}

// 添加模块
export function addModulesBySite(searchCon) {
  return request({
    url: '/zcmtask/zcm/appNavigation/',
    method: 'POST',
    data: searchCon
  })
}

// 编辑模块
export function updateModulesBySite(searchCon) {
  return request({
    url: '/zcmtask/zcm/appNavigation/' + searchCon.id,
    method: 'PUT',
    data: searchCon
  })
}

// 删除模块
export function deleteModulesBySite(searchCon) {
  return request({
    url: '/zcmtask/zcm/appNavigation/force',
    method: 'DELETE',
    data: searchCon
  })
}

// 根据站点查询栏目列表
export function getColumnByModules(searchCon) {
  return request({
    url: '/zcmtask/zcm/appNavigationCategory/compositeSelect',
    method: 'POST',
    data: searchCon
  })
}

// 添加栏目
export function addColumnByModules(searchCon) {
  return request({
    url: '/zcmtask/zcm/appNavigationCategory/',
    method: 'POST',
    data: searchCon
  })
}

// 编辑栏目
export function updateColumnByModules(searchCon) {
  return request({
    // url: '/zcmtask/AppNormalCategory/' + searchCon.id,修改接口
    url: '/zcmtask/zcm/appNavigationCategory/' + searchCon.id,
    method: 'PUT',
    data: searchCon
  })
}

// 删除栏目
export function deleteColumnByModules(searchCon) {
  return request({
    url: '/zcmtask/zcm/appNavigationCategory/force',
    method: 'DELETE',
    data: searchCon
  })
}
// 人员组织机构
export function organization(searchCon) {
  return request({
    url: '/zcmtask//AppNormalCategory/select',
    method: 'POST',
    data: searchCon
  })
}
// 查询栏目详情
export function detailColumnByModules(searchCon) {
  console.log("编辑查看")
  console.log(searchCon)
  console.log("编辑查看")
  return request({
    // url: '/zcmtask//AppNormalCategory/select',//接口修改
    url: '/zcmtask/AppNormalCategory/findById',
    method: 'POST',
    data: searchCon
  })
}
// /zcmtask/AppNavigationCategory / select

// 树形结构树
export function treeByParentId(searchCon) {
  return request({
    url: '/uums/SysOrgInfo/treeByParentId',
    method: 'POST',
    data: searchCon
  })
}
// 模块列表分享
export function findShareCategory(searchCon) {
  return request({
    url: '/zcmtask/zcm/appNavigationCategory/findShareCategory' + searchCon,
    method: 'POST',
    data: searchCon
  })
}
// 确定模块列表分享
export function updateShareCategory(searchCon) {
  return request({
    url: '/zcmtask/zcm/appNavigationCategory/updateShareCategory' + searchCon,
    method: 'POST',
    data: searchCon
  })
}
// 共享到站点
export function selectTerminalTag(searchCon) {
  return request({
    url: '/zcmtask/TerminalCategoryShared/selectTerminalTag',
    method: 'POST',
    data: searchCon
  })
}
// 共享到站点确定
export function insertTerminalCategory(searchCon) {
  return request({
    url: '/zcmtask/TerminalCategoryShared/insertTerminalCategory',
    method: 'POST',
    data: searchCon
  })
}
// 取消分享
export function cancelShareCategory(searchCon) {
  return request({
    url: '/zcmtask/zcm/appNavigationCategory/cancelShareCategory?id=' + searchCon,
    method: 'POST',
    data: searchCon
  })
}
// 获取内容版本
export function findContentByVersion(searchCon) {
  return request({
    url: '/zcm/zcm/nrsh/findContentByVersion',
    method: 'POST',
    data: searchCon
  })
}
// 通过微信号获取文章
export function weChatReleaseByTitleList(searchCon) {
  return request({
    url: '/zcm/zcm/nrsh/queryWaitPublicListByWechat',
    method: 'POST',
    data: searchCon
  })
}
// 微信组合发布
export function publicWeChatArticle(searchCon) {
  return request({
    url: '/zcm/zcm/nrsh/publicWeChatArticle',
    method: 'POST',
    data: searchCon
  })
}
